package com;

import com.alibaba.fastjson.JSON;
import com.dep.DecryptTaoBaoStrUtil;
import com.dep.MessageVo;
import com.yuhang.demo.util.PostUtil;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * @user yuhang
 * @desc
 * @since 2022/1/14
 */
public class TaobaoMessage {

    public static String api = "http://127.0.0.1:8806";

    public static void main(String[] args) throws IOException {

        String ret = getRefundMessageList();


        System.out.println(DecryptTaoBaoStrUtil.decrypt(ret));

    }


    private static String getRefundMessageList() throws IOException {
        String url = api + "/taobao/getRefundMessageList";
        List<NameValuePair> formparams = new ArrayList<NameValuePair>();
        RefundVo vo = new RefundVo();
        vo.setExpressNos("1111");
        String m = DecryptTaoBaoStrUtil.encrypt(JSON.toJSONString(vo));
        formparams.add(new BasicNameValuePair("json", m));//264
        return PostUtil.httpPost(url, formparams);
    }

}
